Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
npm install glam
@apply
!input -
// index.js
import css from 'glam'
let myColor = '#ab67ee'
let radius = '20px'
let myClass = css`
color: red;
&:hover {
font-weight: bold;
color: ${myColor};
border-radius: ${radius};
}
`
// ...
<div class={myClass}>
what up homies
</div>
`
output -
// index.js
import css from 'glam'
let myColor = '#ab67ee'
let radius = '20px'
let myClass = css('css-1bh6s', [myColor, rad])
// generates "css-1bh6s vars-h23psd"
/* index.js.css */
.css-1bh6s {
color: red
}
.css-1bh6s:hover {
font-weight: bold;
color: var(--css-1bh6s-0);
border-radius: var(--css-1bh6s-1);
}
/* dynamically added */
.vars-h23psd {
--css-1bh6s-0: #ab67ee;
--css-1bh6s-1: 20px;
}
glam lets you define reusable css fragment
s that can be
mixed in with css
and fragment
definitions
import css, {fragment} from 'glam'
let huge = 100,
tiny = 6
let bold = fragment`
display: flex;
font-weight: bold;`
let big = fragment`
@apply ${bold};
font-size: ${huge}`
let small = fragment`
font-size: ${tiny}`
<div className={css`
@apply ${props.error ? big : small};
color: red
`}>
compose all your classes!
</div>
pass a name
to generate readable classnames
let cls = css`
name: big;
font-size: 40px;
`
// big-f8xd3
this lib was designed to leverage compile-time to provide great DX, and ship only enough js as required for the interactive portions.
@apply
@apply
spec is stalled, and might never make it in.glam/babel
to your babel pluginsglam/loader
to webpack's css loadersglam can 'polyfill' for browsers that don't support css vars and / or @apply
.
fancy! you could then generate separate bundles targeting different browsers.
inline
- bool - default false
add require('./path/to/file.js.css')
statements as required.
some options to bundle and serve this css -
style-loader
/css-loader
file-loader
and load it with link tags and/or @import
glam/loader
glam/server
to extract 'precise' css from htmlI hope to make this simpler.
for stuff like animations, you could define your own css
variant,
further bringing down runtime cost
(react@16.alpha-11 and above)
function css(cls, vars = []){
return {
className: cls,
style: vars.reduce((o, v, i) =>
(o[`--${cls}-${i}`] = v, o), {})
}
}
// ...
<div {...css` font-weight:bold; color: ${props.color}; `}>
hello!
</div>
glam
package name!FAQs
inline css for your jsx
The npm package glam receives a total of 7,651 weekly downloads. As such, glam popularity was classified as popular.
We found that glam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.